import axios from "./axios";

/**
 * 列表
 * @param {
 * current
 * name
 * size
 * status
 * type
 * }
 * @returns
 */
export const list = (data) => {
  return axios.post("system-menu/page", data);
};

/**
 *
 * @param {*} data
 * @returns
 */

export const add = (data) => {
  return axios.post("system-menu", data);
};

/**
 *
 * @param {*} data
 * @returns
 */

export const update = (data) => {
  return axios.put("system-menu", data);
};

/**
 *
 * @param {*} data
 * @returns
 */

export const del = (data) => {
  return axios.delete("system-menu/" + data);
};

/**
 * 获取指定ID的菜单内容
 * @param {parentId} data
 * @returns
 */

export const get = (data) => {
  return axios.get("system-menu/" + data);
};

/**
 * 获取父子级菜单用于下拉选择
 * @param {} data
 * @returns
 */

export const select = (data) => {
  return axios.get("system-menu/select", data);
};
/**
 * 获取父子级菜单用于下拉选择
 * @param {} data
 * @returns
 */

export const selectAll = (data) => {
  return axios.get("system-menu/select-all", data);
};
/**
 * 获取指定角色的菜单
 * @param {} data
 * @returns
 */

export const tree = () => {
  return axios.get("system-menu/licence");
};
